package com.jqq.map_;

import java.util.Properties;

/**
 * @author 姬倩倩
 * @version 1.0
 */
@SuppressWarnings({"all"})
public class Properties_ {
    public static void main(String[] args) {
        Properties properties = new Properties();
        properties.put("john", 100);
        properties.put("lucy", 100);
        //k-v不能为null，会抛出NullPointerException
//        properties.put(null, 100);
        //如果有相同的键值，value也会被替换
        properties.put("john", 88);
        System.out.println(properties);

        //通过key获取对应的value
        System.out.println(properties.get("john"));
        //删除
        properties.remove("lucy");
        System.out.println(properties);
    }
}
